package com.sweet.thread;

import java.text.SimpleDateFormat;
import java.util.Date;

// 模拟倒计时 并打印系统时间
public class TestSleep3 {
    public static void main(String[] args) throws InterruptedException {
        // 打印当前系统时间
        Date dt = new Date(System.currentTimeMillis());
        while (true) {
            Thread.sleep(1000);
            System.out.println(new SimpleDateFormat("HH:mm:ss").format(dt));
            dt = new Date(System.currentTimeMillis());
        }
    }

}
